package cdu.bbs.bbsv2.service.impl;

import cdu.bbs.bbsv2.mapper.CommentMapper;
import cdu.bbs.bbsv2.domain.Comment;
import cdu.bbs.bbsv2.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private  CommentMapper commentMapper;
    @Override
    public List<Comment> getComments(String id) {
        return commentMapper.getComments(id);
    }

    @Override
    public boolean addComment(Comment comment) {
        return commentMapper.addComment(comment) == 1?true:false;
    }
}
